package com.zyq.service.impl;

import com.zyq.mapper.BloodSugarMapper;
import com.zyq.model.entity.BloodSugar;
import com.zyq.service.IBloodSugarService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * blood_sugarService业务层处理
 *
 * @author zyq
 * @date 2022-04-08
 */
@Service
public class BloodSugarServiceImpl implements IBloodSugarService
{
    @Autowired
    private BloodSugarMapper bloodSugarMapper;

    /**
     * 查询blood_sugar
     *
     * @param id blood_sugarID
     * @return blood_sugar
     */
    @Override
    public BloodSugar selectBloodSugarById(Long id)
    {
        return bloodSugarMapper.selectBloodSugarById(id);
    }

    /**
     * 查询blood_sugar列表
     *
     * @param bloodSugar blood_sugar
     * @return blood_sugar
     */
    @Override
    public List<BloodSugar> selectBloodSugarList(BloodSugar bloodSugar)
    {
        return bloodSugarMapper.selectBloodSugarList(bloodSugar);
    }

    /**
     * 新增blood_sugar
     *
     * @param bloodSugar blood_sugar
     * @return 结果
     */
    @Override
    public int insertBloodSugar(BloodSugar bloodSugar)
    {
        return bloodSugarMapper.insertBloodSugar(bloodSugar);
    }

    /**
     * 修改blood_sugar
     *
     * @param bloodSugar blood_sugar
     * @return 结果
     */
    @Override
    public int updateBloodSugar(BloodSugar bloodSugar)
    {
        return bloodSugarMapper.updateBloodSugar(bloodSugar);
    }

    /**
     * 批量删除blood_sugar
     *
     * @param ids 需要删除的blood_sugarID
     * @return 结果
     */
    @Override
    public int deleteBloodSugarByIds(Long[] ids)
    {
        return bloodSugarMapper.deleteBloodSugarByIds(ids);
    }

    /**
     * 删除blood_sugar信息
     *
     * @param id blood_sugarID
     * @return 结果
     */
    @Override
    public int deleteBloodSugarById(Long id)
    {
        return bloodSugarMapper.deleteBloodSugarById(id);
    }

    @Override
    public List<BloodSugar> select7dayList(Long userId){
        return bloodSugarMapper.select7dayList(userId);
    }
}
